<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <title>w0924_3_DateObject</title>
      <script>
         // Date객체----------------------------------
         // 특정 날짜와 시간
         //var d1 = new Date(dateString);
         var d1 = new Date('October 13, 2014 17:10:58');
         document.writeln("d1 : "+d1.toLocaleString());
         document.writeln("<hr/>");
         
         // New Date(milliseconds);
         var d2 = new Date(0);
         document.writeln("d2 : "+d2.toLocaleString());
         document.writeln("<hr/>");
         
         // new Date(year, month, day, hours, minutes, seconds, milliseconds);
         // month에서 1월은 0.
         var d3 = new Date(2014,0,1,13,34,45);
         document.writeln("d3 : "+d3.toLocaleString());
         document.writeln("<hr/>");

         // 년, 월, 일, 시, 분, 초, 요일 가져오기
         document.writeln('getFullYear() : '+d3.getFullYear());
         document.writeln('getMonth() : '+d3.getMonth());
         document.writeln('getDate() : '+d3.getDate());
         document.writeln('getHours() : '+d3.getHours());
         document.writeln('getMinutes() : '+d3.getMinutes());
         document.writeln('getSeconds() : '+d3.getSeconds());
         document.writeln('getMilliseconds() : '+d3.getMilliseconds());
         document.writeln('getTime() : '+d3.getTime());
         
         document.writeln("<hr/>");
         
         // 현재 날짜와 시간
         var today = new Date();
         
         document.write('<pre>');
         document.writeln('today : '+today);
         document.writeln('typeof today : '+typeof today);
         document.writeln('today.toString() : '+today.toString());
         document.writeln('typeof today.toString() : '+typeof today.toString());
         document.writeln('today.toUTCString() : '+today.toUTCString());
         document.writeln('today.toLocaleString() : '+today.toLocaleString());
         document.write('<pre>');
         
         document.writeln("<hr/>");
         document.writeln("<hr/>");
         
         var t= new Date();
         var h=t.getHours();
         
         if(h <= 7)
       	 {
       	 	document.write("good Morning");
       	 }else if((h > 7) && (h < 18) ){
			document.write("좋은 하루 출력");
       	 }else if((h >= 18) && (h <= 24) ){
       		 	document.write("잘자용");
       		 };
         
       	 document.writeln("<hr/>");
         document.writeln("<hr/>");       		 
         
         //pic 요소의 속성변경
         var pic=document.getElementById("i1");
         document.write("pic : "")
         
         
         
      </script>
   </head>

   <body>
      
   </body>
</html>